* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.main-content {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

.input-section, .tree-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.section-header {
    padding: 20px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.input-controls, .tree-controls, .table-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background: #e74c3c;
    color: white;
}

.btn-primary:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
    transform: translateY(-2px);
}

#jsonInput {
    flex: 1;
    padding: 20px;
    border: none;
    outline: none;
    resize: none;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    background: #f8f9fa;
    color: #2c3e50;
}

.input-status {
    padding: 10px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.status-indicator.valid {
    color: #27ae60;
}

.status-indicator.invalid {
    color: #e74c3c;
}

.status-indicator.waiting {
    color: #f39c12;
}

.json-tree {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.tree-node {
    margin-bottom: 5px;
}

.tree-node.root {
    margin-left: 0;
    border-left: none;
    padding-left: 0;
}

.tree-children {
    margin-left: 20px;
    border-left: 2px solid #e9ecef;
    padding-left: 15px;
    margin-top: 5px;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    position: relative;
}

.tree-item:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

.tree-item.array-item {
    background-color: #e8f5e8;
    border: 2px solid #27ae60;
    cursor: pointer;
    font-weight: 500;
}

.tree-item.array-item:hover {
    background-color: #d4edda;
    border-color: #219a52;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.tree-item.array-item::after {
    content: "👆 点击查看表格";
    position: absolute;
    right: 10px;
    font-size: 12px;
    color: #27ae60;
    font-weight: normal;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tree-item.array-item:hover::after {
    opacity: 1;
}

.tree-toggle {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    background: #3498db;
    color: white;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.tree-toggle:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.tree-key {
    font-weight: 600;
    color: #8e44ad;
    flex-shrink: 0;
}

.tree-value {
    color: #2c3e50;
    word-break: break-all;
}

.tree-value.string {
    color: #27ae60;
}

.tree-value.number {
    color: #e74c3c;
}

.tree-value.boolean {
    color: #f39c12;
}

.tree-value.null {
    color: #95a5a6;
    font-style: italic;
}

.tree-type {
    font-size: 12px;
    color: #7f8c8d;
    font-style: italic;
    flex-grow: 1;
}

.tree-item.array-item .tree-type {
    color: #27ae60;
    font-weight: 500;
}

.table-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.table-section .section-header {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.array-path {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
}

.table-container {
    flex: 1;
    overflow: auto;
    padding: 20px;
    max-width: 100%;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #fff;
    overflow-x: auto;
    overflow-y: auto;
}

#dataTable {
    width: auto;
    border-collapse: collapse;
    min-width: 100%;
    white-space: nowrap;
    table-layout: auto;
}

#dataTable th,
#dataTable td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    border-right: 1px solid #f8f9fa;
    min-width: 120px;
    max-width: none;
    white-space: nowrap;
    overflow: visible;
}

#dataTable th:last-child,
#dataTable td:last-child {
    border-right: none;
}

#dataTable th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #dee2e6;
}

#dataTable tr:hover {
    background-color: #f8f9fa;
}

#dataTable td {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    white-space: nowrap;
}

/* 表格滚动条样式优化 */
.table-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 6px;
    border: 2px solid #f1f1f1;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.table-container::-webkit-scrollbar-corner {
    background: #f1f1f1;
}

/* 通用滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }
    
    .input-section, .tree-section {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .input-controls, .tree-controls, .table-controls {
        justify-content: center;
    }
    
    .tree-item.array-item::after {
        display: none;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container > * {
    animation: fadeIn 0.6s ease-out;
}

.tree-node {
    animation: fadeIn 0.3s ease-out;
} 